package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.MeetingRoomInfoMapper;
import com.ruoyi.system.domain.MeetingRoomInfo;
import com.ruoyi.system.service.IMeetingRoomInfoService;
import com.ruoyi.common.core.text.Convert;

/**
 * 会议室信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-01
 */
@Service
public class MeetingRoomInfoServiceImpl implements IMeetingRoomInfoService 
{
    @Autowired
    private MeetingRoomInfoMapper meetingRoomInfoMapper;

    /**
     * 查询会议室信息
     * 
     * @param roomId 会议室信息主键
     * @return 会议室信息
     */
    @Override
    public MeetingRoomInfo selectMeetingRoomInfoByRoomId(Long roomId)
    {
        return meetingRoomInfoMapper.selectMeetingRoomInfoByRoomId(roomId);
    }

    /**
     * 查询会议室信息列表
     * 
     * @param meetingRoomInfo 会议室信息
     * @return 会议室信息
     */
    @Override
    public List<MeetingRoomInfo> selectMeetingRoomInfoList(MeetingRoomInfo meetingRoomInfo)
    {
        return meetingRoomInfoMapper.selectMeetingRoomInfoList(meetingRoomInfo);
    }

    /**
     * 新增会议室信息
     * 
     * @param meetingRoomInfo 会议室信息
     * @return 结果
     */
    @Override
    public int insertMeetingRoomInfo(MeetingRoomInfo meetingRoomInfo)
    {
        meetingRoomInfo.setCreateTime(DateUtils.getNowDate());
        return meetingRoomInfoMapper.insertMeetingRoomInfo(meetingRoomInfo);
    }

    /**
     * 修改会议室信息
     * 
     * @param meetingRoomInfo 会议室信息
     * @return 结果
     */
    @Override
    public int updateMeetingRoomInfo(MeetingRoomInfo meetingRoomInfo)
    {
        return meetingRoomInfoMapper.updateMeetingRoomInfo(meetingRoomInfo);
    }

    /**
     * 批量删除会议室信息
     * 
     * @param roomIds 需要删除的会议室信息主键
     * @return 结果
     */
    @Override
    public int deleteMeetingRoomInfoByRoomIds(String roomIds)
    {
        return meetingRoomInfoMapper.deleteMeetingRoomInfoByRoomIds(Convert.toStrArray(roomIds));
    }

    /**
     * 删除会议室信息信息
     * 
     * @param roomId 会议室信息主键
     * @return 结果
     */
    @Override
    public int deleteMeetingRoomInfoByRoomId(Long roomId)
    {
        return meetingRoomInfoMapper.deleteMeetingRoomInfoByRoomId(roomId);
    }
}
